package com.teckteam.ptvsystem.controller;

import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Generic Window closing actionlistener
 *
 */
public class CancelWindowListener implements ActionListener
{
   private Window dialog;
   
   /**
    * Constructor for window cancel button
    */
   public CancelWindowListener(Window dialog)
   {
      this.dialog = dialog;
   }
   
   public void actionPerformed(ActionEvent e)
   {
      System.out.println("Closing prompt");
      dialog.setVisible(false);
      dialog.dispose();
   }
   
}
